<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="__ROOT__/static/plugins/bootstrap/css/bootstrap.css">
    <script src="__ROOT__/static/plugins/jquery-3.2.1/jquery-3.2.1.min.js"></script>
    <script src="__ROOT__/static/plugins/layer/layer.min.js"></script>
</head>
<style>
    a{ color:#fcfcfc;  }
</style>
<body>
<div  style="text-align: center;color:red;"  >
    用于前端的评价显示
</div>
<table class="table table-hover table-striped table-bordered wst-form">
    <tr>
        <th  style="width: 20%;"   >商品名称</th>
        <td  style="width: 50%;" >评价内容</td>
        <td  style="width: 20%;"  >评价时间</td>
        <td style="width: 10%;" >操作</td>
    </tr>
    {volist name="rows" id="data" key="k" }
    <tr>
        <td>{$data['goods_name']}</td>
        <td>{$data['appraise_content']}</td>
        <td>{:date('Y-m-d  H:i:s',$data['appraise_time'])}</td>
        <td>
            <a  href="javascript:; "  class="btn btn-danger glyphicon glyphicon-trash"  onclick="deleteGoodsAppraises({$data['id']})"   >
                删除
            </a>
        </td>
    </tr>
    {/volist}
    <tr>
        <th  colspan="4" style="text-align: center;"   >{$page}</th>
    </tr>
</table>
</body>
<script>
    function deleteGoodsAppraises(id){
        layer.confirm('您确定要删除吗', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            layer.msg('正在操作，请稍后...', {icon: 16});
            $.post("{:url('Admin/Goodscats/deleteGoodsAppraises')}", { id: id}, function (data) {
                console.debug(data);
                if (data > 0) {
                    layer.msg('操作成功', {icon: 1, time: 3000});
                    setTimeout('window.location.href = "{:url(\'Admin/Goodscats/goodsAppraises\')}"',2000);
                } else {
                    layer.msg('操作失败', {icon: 2, time: 3000});
                }
            });
        });
    }
</script>
</html>